namespace DK.Utils.Schedule;


public class DelayTask(int millisecondsTimeout, int count, Action<TimerTaskEventArgs> taskAction)
    : TimerTask(millisecondsTimeout)
{
    protected override void PollerExecute(TimerTaskEventArgs args)
    {
        if (args.ExecuteCount < count)
        {
            taskAction(Args);
        }
        else
        {
            Poller.Kill();
        }
    }
}

